package day06;
//方法的演示
public class MethodDemo {
    public static void main(String[] args) {
        int num1=55,num2=66;
         int num=plus(num1,num2);
         System.out.println(num);
       eat();
       drink();
      System.out.println(newRandom(100));
      System.out.println(quotient(789,654));
      System.out.println(minus(987,546));










        /*say();
        sayHi("250");
        sayHi("傻子");
        sayHello("day佬",18);
        double d=getNum();
        System.out.println(d);
        int m=5,n=6;
        int b=plus(m,n);
        System.out.println(b);

        System.out.println( plus(100,1));

         */
    }
      /*
    //无参无返回值
    public static void  say(){
        System.out.println("大家好我是渣渣辉");
    }
   public static void  sayHi(String name){
        System.out.println("大家好我是"+name+"谢谢大家");
   }
   public static void sayHello(String name,int age){
        System.out.println("大家好我是"+name+",今年"+age+"岁了");
   }

   public static double getNum(){
        //在有返回值的方法中
       //--必须得通过return来返回一个值，并且这个值的类型必须与返回类型匹配
       //return “abc”
       System.out.println(12313213);
       return 8.88;
   }

   //有参有返回值
   public static int plus(int num1,int num2){
        int num=num1+num2;
        getNum();
        return num;
   }


       */


    //定义6个方法
    //方法1
    public static void eat(){
        System.out.println("我吃了");
    }

    //方法2
   public static void  drink(){
        System.out.println("我喝了");
   }

   //方法3
    public static int plus(int num1,int num2){
        int num=num1+num2;

        return num;
    }


    //方法4
    public static int newRandom(int num){//整数随机方法
        int num1=(int) (Math.random()*num);
        return num1;
    }
  //方法5
    public static double quotient(double num1,double num2){
        double num=num1/num2;
        return num;
    }
 //方法6
    public static int minus(int num1,int num2){
        int num=num1-num2;
        return num;
    }


}
